package _06_binaryTree;

public class BinaryNode<T> {
    
    // 地址域
    public T data;
    // 地址域，左孩子和右孩子结点
    public BinaryNode<T> left, right;
    
    // 构造结点
    public BinaryNode(T data, BinaryNode<T> left, BinaryNode<T> right) {
        this.data = data;
        this.left = left;
        this.right = right;
    }
    
    // 构造元素为data的叶子结点
    public BinaryNode(T data) {
        this.data = data;
    }
    
    // 返回结点数据域的描述字符串
    public String toString() {
        return data.toString();
    }
    
    // 判断是否为叶子结点
    public boolean isLeaf() {
        return left == null && right == null;
    }
    
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        
    }

}
